<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/base/tag.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<LINK rel="stylesheet" type="text/css"
	href="${baseurl}js/easyui/styles/default.css">
<%@ include file="/WEB-INF/jsp/base/common_css.jsp"%>
<%@ include file="/WEB-INF/jsp/base/common_js.jsp"%>
<title>用户管理</title>

<script type="text/javascript">
	//datagrid列定义
	var columns_v = [ [{
		field : 'name',
		title : '名称',
		align :'center',
		width : 150
	}, {
		field : 'headerURL',
		title : '头像 ',
		align :'center',
		width : 150,
		formatter:function(value, row, index){
		    return "<a href=javascript:queryPic('"+row.ID+"')>查看图片</a>";
		}
	}, {
		field : 'star',
		title : '星级',
		align :'center',
		width : 150,
		formatter:function(value, row, index){
		    if(value=='1'){
		       return "<img src='${baseurl}images/icon-star.png'></img>";
		    }else if(value=='2'){
		      return "<img src='${baseurl}images/icon-star.png'></img><img src='${baseurl}images/icon-star.png'></img>";
		    }else if(value=='3'){
		      return "<img src='${baseurl}images/icon-star.png'></img><img src='${baseurl}images/icon-star.png'></img><img src='${baseurl}images/icon-star.png'></img>";
		    }else if(value=='4'){
		      return "<img src='${baseurl}images/icon-star.png'></img><img src='${baseurl}images/icon-star.png'></img><img src='${baseurl}images/icon-star.png'></img><img src='${baseurl}images/icon-star.png'></img>";
		    }else if(value=='5'){
		      return "<img src='${baseurl}images/icon-star.png'></img><img src='${baseurl}images/icon-star.png'></img><img src='${baseurl}images/icon-star.png'></img><img src='${baseurl}images/icon-star.png'></img><img src='${baseurl}images/icon-star.png'></img>";
		    }
		}
	}, {
		field : 'times',
		title : '交易次数',
		align :'center',
		width : 150
		
	}, {
		field : 'amount',
		title : '交易额',
		width : 150,
		align :'center',
	}, {
		field : 'opt1',
		title : '操作',
		align :'center',
		width : 150,
		formatter : function(value, row, index) {
			return "<a href=javascript:findinfo('"+row.ID+"')>详情</a>";
		}
	} ] ];
//￥
	//加载datagrid
	$(function() {
		$('#orderlist').datagrid({
			title : '客户列表',
			nowrap : true,//单元格中的数据不换行，如果为true表示不换行，不换行情况下数据加载性能高，如果为false就是换行，换行数据加载性能不高
			striped : true,
			url : "${pageContext.request.contextPath}/customer/queryCustomerList",//
			idField : 'ID',//
			loadMsg : '',
			columns : columns_v,
			pagination : true,//是否显示分页
			rownumbers : true,//是否显示行号
			pageList:[5,10,20]
		});
	});
	
	//搜索方法
	function queryorder(){
		var formdata = $("#orderqueryForm").serializeJson();
		$('#orderlist').datagrid('load',formdata);
	}
    //查看顾客详情
    function findinfo(ID){
       createmodalwindow("顾客详情", 900, 500, '${baseurl}customer/customerDetail?id='+ID);
    }
   //查看图片
   function queryPic(ID){
	  createmodalwindow("顾客头像", 400, 400, '${baseurl}customer/queryPic?id='+ID);
   }
</script>
</head>
<body>
<div style="height:30px;border:1px solid #CCC">
             <TR>
				<TD height=12 style="font-size: 15px">首页  &nbsp;&nbsp; ></TD>
				<TD height=12 style="font-size: 15px" >客户管理 </TD>
			</TR>
</div>
  <form id="orderqueryForm">
	<!-- 查询条件 -->
	<TABLE class="table_search" style="margin-top :10px">
		<TBODY>
			<TR>
				<TD class="left">客户名称：</td>
				<td><INPUT type="text" name="name" /></TD>
				<TD class="left">星级：</TD>
				<td><INPUT type="text" name="star" /></TD>
				<TD class="left">交易次数：</TD>
				<td><INPUT type="text" name="times" /></TD>
			</TR>
			<TR>
			<TD class="left">交易额：</TD>
				<td><INPUT type="text" name="amount" /></TD>
			   <TD class="left">时间从：</TD>
			   <td> <INPUT id="startTime" name="startTime" 
							 onfocus="WdatePicker({isShowWeek:false,skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" style="width:80px"/>到
					 <INPUT id="endTime" name="endTime"
							 onfocus="WdatePicker({isShowWeek:false,skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" style="width:80px"/></TD>
				<td>
				<a id="btn" href="#" onclick="queryorder()"
					class="easyui-linkbutton" iconCls='icon-search'>确定</a></td>
			</TR>
		</TBODY>
	</TABLE>

	<!-- 查询列表 -->
	<TABLE border=0 cellSpacing=0 cellPadding=0 width="99%" align=left style="margin-top :10px">
		<TBODY>
			<TR>
				<TD>
					<table id="orderlist">
				
					
					</table>
				</TD>
			</TR>
		</TBODY>
	</TABLE>
</form>

<form id="removeOrderForm" action="" method="post">
  <input type="hidden" id="delete_id" name="id" />
</form>
</body>
</html>